package cn.udrm.water.base.v1.waterdistribute.entities;

import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedAttributeNode;
import javax.persistence.NamedEntityGraph;
import javax.persistence.NamedEntityGraphs;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import org.hibernate.annotations.GenericGenerator;

/**
 * 闸门生产厂商
 * @author liukang
 * @date 2018年11月7日
 */
@Getter
@Setter
@Entity(name="WaterGateVendor")
@Table(name="A_WATER_GATE_VENDOR")
@NamedEntityGraphs({
	@NamedEntityGraph(name="WaterGateVendor.all",
			attributeNodes={
			@NamedAttributeNode("waterGates")
	})
})
@NoArgsConstructor
public class WaterGateVendor {


	@Id
	@GenericGenerator(name="idGenerator", strategy="uuid")
	@GeneratedValue(generator="idGenerator")
	@Column(name="ID")
	private String id;
	/*
	 * 系统编码
	 */
	@Column(name="ENTITY_CODE")
	private String entityCode;
	@Column(name="CREATE_DATE")
	private Date createDate;
	@Column(name="PERSON_GUID")
	private String personGuid;
	@Column(name="PERSON_NAME")
	private String personName;
	
	@Column(name="NAME")
	private String name;
	@Column(name="INFO_REMARKS", length=2048)
	private String infoRemarks;
	/*
	 * 以下为外键
	 */
	@ApiModelProperty(hidden=true)
	@OneToMany(fetch=FetchType.LAZY, mappedBy="waterGateVendor")
	private List<WaterGate> waterGates;

	public WaterGateVendor(String id) {
		this.id = id;
	}
	
}
